package com.smarth.zhizulian.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;


/**
 * Created by LV.3 on 2016/12/9.
 */

public class MyPagerAdapter extends FragmentPagerAdapter {
    List<Fragment> mFragmentList;
    List<String> mTitleList;
    Context mContext;

    public MyPagerAdapter(Context context, FragmentManager fm, List<Fragment> fragmentList, List<String> titleList) {
        super(fm);
        this.mContext = context;
        this.mFragmentList = fragmentList;
        this.mTitleList = titleList;
    }


    @Override
    public Fragment getItem(int position) {
        return mFragmentList.get(position);
    }

    @Override
    public int getCount() {
        return mFragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitleList.get(position);
    }

    public List<Fragment> getFragmentList() {
        return mFragmentList;
    }

    public void setFragmentList(List<Fragment> mFragmentList) {
        this.mFragmentList = mFragmentList;
    }

    public List<String> getTitleList() {
        return mTitleList;
    }

    public void setTitleList(List<String> mTitleList) {
        this.mTitleList = mTitleList;
    }

}
